import React, { Component } from 'react'

import { Route, Link } from 'react-router-dom'


// const Child = (props) => {
//   return (
//     <div>child</div>
//   )
// }

class Child extends Component {
  render() {
    return (
      <div>child { this.props.match.params.id}</div>
    )
  }
  componentDidMount() {
    console.log(this)
    // this.props.match.params.id
  }
}

export default class UrlParameters extends Component {
  render() {
    return (
      <div>
        <Link to="aaa">aaa</Link> <br/>
        <Link to="bbb">bbb</Link> <br/>
        <Link to="ccc">ccc</Link> 
        <Route path="/:id" component={Child}></Route>
      </div>
    )
  }
}
